import { ReactElement } from 'react';
import { CloseOutline } from 'antd-mobile-icons';
import './Tag.less';

type Iprops = {
  showValue: string[];
  remove: Function;
};

function Tag(props: Iprops): ReactElement {
  let { showValue, remove } = props;
  return (
    <div className="EformTags">
      {showValue.map((item: any, index: number) => {
        return (
          <div className="tag-item" key={index}>
            <span>{item.Name}</span>
            <div style={{ width: '14px' }}>
              <CloseOutline
                fontSize={12}
                className="tag-item-icons"
                onClick={(e) => {
                  remove(item);
                }}
              />
            </div>
          </div>
        );
      })}
    </div>
  );
}
export default Tag;
